<template>
  <component :is="componentName" :id="rowId" @subPage="subPage"></component>
</template>
<script setup lang="ts" name="venueManage">
import TableModel from './tableModel.vue'
import FormModel from './formModel.vue'
import DetailModel from '@/views/components/venueDetail/index.vue'

let rowId: undefined | number = undefined
const componentName: Record<string, any> = ref(TableModel)
const pageList = [TableModel, FormModel, DetailModel]
const subPage = (index: number, id?: number) => {
  componentName.value = pageList[index]
  if (index === 2) {
    rowId = id
  }
}
</script>
